<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<link rel="stylesheet" href="__PUBLIC__/Bootstrap/Css/bootstrap.min.css" />
	<link rel="stylesheet" href="__PUBLIC__/Css/common.css" />
	<style type="text/css">
		body{
			margin-bottom: 100px;
		}
	</style>
</head>
<body>
	<div class="container-fluid">
	<div class="row-fluid">
	<div class="span12">

	<table class="table table-bordered table-hover">
		<tr>
			<th>ID</th>
			<th>商品名称</th>
			<th>价格</th>
			<th>库存</th>
			<th>点击次数</th>
			<th>添加时间</th>
			<th>操作</th>
		</tr>	
		<foreach from="$data" key="$k" value="$v">	
		<tr class="info">
			<td>{$v.gid}</td>
			<td>{$v.gname}</td>
			<td>
				<ul>
					<li>市场价：<del>&yen;{$v.market_price}</del></li>
					<li>商城价：<span>&yen;{$v.mall_price}</span></li>
				</ul>
			</td>
			<td>{$v.total}</td>
			<td>{$v.click_num}</td>
			<td>{$v.shelf_time|date:'Y-m-d',@@}</td>
			<td>
				<a href="{|U:'GoodsList/index',array('gid'=>$v['gid'])}" class="btn btn-success"><i class="icon-th icon-white"></i>货品列表</a>
				<a href="{|U:'edit',array('gid'=>$v['gid'])}" class="btn btn-warning"><i class="icon-pencil icon-white"></i>修改</a>
				<a href="javascript:del({$v.gid})" class="btn btn-primary"><i class="icon-th-list icon-white"></i>上架</a>
				<a href="javascript:reldel({$v.gid})" class="btn btn-danger"><i class="icon-trash icon-white"></i>删除</a>
			</td>
		</tr>
		</foreach>
		
	</table>
	<script type="text/javascript">
	function del(gid){
		if(confirm('确定要上架吗？')){
				location.href = "{|U:'Admin/Goods/up'}" + "&gid=" + gid;
			}
	}
	function reldel(gid){
		if(confirm('确定要删除吗？删除商品会把该商品的货品一起删除')){
				location.href = "{|U:'Admin/Goods/reldel'}" + "&gid=" + gid;
			}
	}
	</script>
	</div>
	</div>
	</div>
</body>
</html>